from utilities import *

from toee import *

def san_dialog( attachee, triggerer ):
	if (game.global_flags[989] == 1):
		triggerer.begin_dialog( attachee, 130 )
	elif (game.global_flags[982] == 1):
		triggerer.begin_dialog( attachee, 180 )
	elif (attachee.has_met( triggerer )) and (game.global_flags[983] == 0) and (game.global_flags[984] == 0):
		triggerer.begin_dialog( attachee, 140 )
	elif (attachee.has_met( triggerer )) and (game.global_flags[983] == 1) and (game.global_flags[984] == 0):
		triggerer.begin_dialog( attachee, 150 )
	elif (attachee.has_met( triggerer )) and (game.global_flags[983] == 0) and (game.global_flags[984] == 1):
		triggerer.begin_dialog( attachee, 160 )
	else:
		triggerer.begin_dialog( attachee, 1 )
	return SKIP_DEFAULT

def san_will_kos( attachee, triggerer ):
	if (game.global_flags[989] == 1):
		attachee.attack(game.leader)
		game.new_sid = 0
		return RUN_DEFAULT
